'''
Description: 
Author: Zilu
Date: 2021-11-03 23:15:00
Version: 
LastEditTime: 2021-11-03 23:57:47
LastEditors: Zilu
'''

# python有两种循环
# 一种是 for...in 循环
names = ["Michael", "Bob", "Tracy"]
for name in names:
    print(name)
for num in range(5):
    print(num)

# 第二种是 while 循环
sum = 0
n = 99
while n > 0:
    sum += n
    n -= 2
print(sum)

# break 可以破坏循环
n = 1
while n < 100:
    if (n > 10):
        break
    print(n)
    n += 1

# continue 可以跳过某次循环
n = 0
while n < 10:
    n += 1
    if n % 2 == 0:
        continue
    print(n)
    
